import axios from '~/axios'

// 添加交易申请确认函
export function addTradeApplicationConfirmLetterApi(data) {
    return axios.post('/basic/lindi/tradeApplicationConfirmLetter/addTradeApplicationConfirmLetter', data)
}

// 删除交易申请确认函
export function deleteTradeApplicationConfirmLetterByConfirmLetterIdApi(confirmLetterId) {
    return axios({
        method: 'DELETE',
        url: '/basic/lindi/tradeApplicationConfirmLetter/deleteTradeApplicationConfirmLetterByConfirmLetterId',
        params: {
            confirmLetterId: confirmLetterId
        }
    })
}

// 修改交易申请确认函
export function updateTradeApplicationConfirmLetterByConfirmLetterIdApi(data) {
    return axios.put('/basic/lindi/tradeApplicationConfirmLetter/updateTradeApplicationConfirmLetterByConfirmLetterId', data)
}

// 分页查询交易申请确认函列表
export function getPageTradeApplicationConfirmLetterListApi(params) {
    return axios({
        method: 'GET',
        url: '/basic/lindi/tradeApplicationConfirmLetter/getPageTradeApplicationConfirmLetterList',
        params: params
    })
}

// 根据确认函ID查询交易申请确认函详情
export function getTradeApplicationConfirmLetterByConfirmLetterIdApi(confirmLetterId) {
    return axios.get(`/basic/lindi/tradeApplicationConfirmLetter/getTradeApplicationConfirmLetterByConfirmLetterId/${confirmLetterId}`)
}

// 根据交易申请ID查询当前确认函
export function getTradeApplicationConfirmLetterByTradeApplicationIdApi(tradeApplicationId) {
    return axios.get(`/basic/lindi/tradeApplicationConfirmLetter/getTradeApplicationConfirmLetterByTradeApplicationId/${tradeApplicationId}`)
}

// 根据交易申请ID查询交易申请确认函列表
export function getTradeApplicationConfirmLetterListByTradeApplicationIdApi(tradeApplicationId) {
    return axios.get(`/basic/lindi/tradeApplicationConfirmLetter/getTradeApplicationConfirmLetterListByTradeApplicationId/${tradeApplicationId}`)
}

// 生成确认函
export function generateConfirmLetterApi(params) {
    return axios({
        method: 'POST',
        url: '/basic/lindi/tradeApplicationConfirmLetter/generateConfirmLetter',
        params: params
    })
}

// 删除交易申请确认函文件
export function deleteTradeApplicationConfirmLetterFileByFileIdApi(fileId) {
    return axios({
        method: 'POST',
        url: '/basic/lindi/tradeApplicationConfirmLetter/deleteTradeApplicationConfirmLetterFileByFileId',
        params: {
            fileId: fileId
        }
    })
}